package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.EcologyPoolDaoRankIncomeConf;
import com.sc.nft.mapper.EcologyPoolDaoRankIncomeConfMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 生态池-品牌榜收益配置(sc_ecology_pool_dao_rank_income_conf)数据DAO
 *
 * @author jinpinhai
 * @description Generator
 * @since 2024-07-17 09:59:00
 */
@Slf4j
@Repository
public class EcologyPoolDaoRankIncomeConfDao extends ServiceImpl<EcologyPoolDaoRankIncomeConfMapper, EcologyPoolDaoRankIncomeConf> {


    /**
     * 根据配置获取排名组合.
     *
     * @param configId
     * @return
     */
    public List<EcologyPoolDaoRankIncomeConf> getConfigId(Long configId) {
        LambdaQueryWrapper<EcologyPoolDaoRankIncomeConf> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(EcologyPoolDaoRankIncomeConf::getEcologyPoolDaoRankConfId, configId);
        wrapper.orderByAsc(EcologyPoolDaoRankIncomeConf::getSort);
        return list(wrapper);
    }
}